﻿<base:PageBase
    xmlns:base="using:Daphne.Modularity.UI"
    x:Class="Daphne.PagesMetro.Pages.LicensesPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Daphne.PagesMetro.Pages"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    
    <Page.Transitions>
        <TransitionCollection>
            <PaneThemeTransition  />
        </TransitionCollection>
    </Page.Transitions>


    <Border Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Padding="30" BorderThickness="0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <!-- Header -->
            <StackPanel Grid.Row="0" >
                <TextBlock FontSize="48" FontWeight="Bold">Knihovny třetích stran</TextBlock>
                <Button x:Name="uxBack" Height="48" HorizontalAlignment="Left" Command="{Binding Path=GoBackCommand}" >Zpět</Button>
            </StackPanel>

            <!-- Content -->
            <Grid Grid.Row="1"  Margin="0,10,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="1*" />
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="0" Grid.Column="0" FontSize="30" FontWeight="Bold" >Seznam knihoven:</TextBlock>
                <TextBlock Grid.Row="0" Grid.Column="1" FontSize="30" FontWeight="Bold" >Licence:</TextBlock>

                <ListBox Grid.Column="0" Grid.Row="1"  ItemsSource="{Binding Path=LibraryList, Mode=OneWay}" HorizontalContentAlignment="Stretch"
                            SelectedItem="{Binding Path=SelectedLibrary, Mode=TwoWay}">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="HorizontalAlignment" Value="Stretch"/>
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Border BorderBrush="OrangeRed" BorderThickness="1" Padding="15" >
                                <Border.Resources>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="Foreground" Value="Black" />
                                    </Style>
                                </Border.Resources>
                                <Border.Background>
                                    <LinearGradientBrush>
                                        <GradientStop Color="LightGray" Offset="0" />
                                        <GradientStop Color="DarkGray" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="1*" />
                                        <ColumnDefinition Width="1*" />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock FontWeight="Bold" TextAlignment="Left" Grid.Row="0" Grid.Column="0" Text="{Binding Path=LibraryName}" />
                                    <TextBlock FontWeight="Bold"  HorizontalAlignment="Right" TextAlignment="Right" Grid.Row="0" Grid.Column="1" Text="{Binding Path=Author}" />
                                
                                    <TextBlock TextWrapping="Wrap" Text="{Binding Path=URL}" Grid.Row="1" Grid.ColumnSpan="2" />

                                </Grid>
                            </Border>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <RichEditBox x:Name="uxLicence" Grid.Column="1" Grid.Row="1" IsReadOnly="True" Margin="2" />
               
            </Grid>
        </Grid>
    </Border>
</base:PageBase>
